package com.jims.master.modules.integratedQuery;

import com.jims.master.common.persistence.Page;
import com.jims.master.common.web.BaseController;
import com.jims.master.modules.doctor.entity.PatVisitIndex;
import com.jims.master.modules.doctor.service.PatVisitIndexService;
import com.jims.master.modules.doctor.service.PatVisitService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by zhangpeng on 2017/7/19.
 */

@Controller
@RequestMapping(value = "${adminPath}/inpPatientInfo")
public class inpPatientInfoController extends BaseController {
    @Autowired
    private PatVisitService patVisitService;
    @Autowired
    private PatVisitIndexService patVisitIndexService;


    /**
     * 在院病人列表
     * @param patVisitIndex
     * @return
     */
    @RequiresPermissions("user")
    @RequestMapping(value = "zYinpPatientinfo")
    public String inpPatientinfo(PatVisitIndex patVisitIndex,Model model,HttpServletRequest request, HttpServletResponse response){
        Page<PatVisitIndex> page = patVisitIndexService.getInpPateientinfoList(new Page<PatVisitIndex>(request, response), patVisitIndex);
        model.addAttribute("patVisitIndex",patVisitIndex);
        model.addAttribute("page",page);
        return "modules/integratedQuery/inpPatientInfo";
    }

    /**
     * 在院病人列表
     * @param patVisitIndex
     * @return
     */
    @RequiresPermissions("user")
    @RequestMapping(value = "Discharge")
    public String getCyPateientinfoList(PatVisitIndex patVisitIndex,Model model,HttpServletRequest request, HttpServletResponse response){
        Page<PatVisitIndex> page = patVisitIndexService.getCyPateientinfoList(new Page<PatVisitIndex>(request,response),patVisitIndex);
        model.addAttribute("patVisitIndex",patVisitIndex);
        model.addAttribute("page",page);
        return "modules/integratedQuery/inpDischargePatientInfo";
    }

}
